# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=qtav
pkgver=1.12.0
pkgrel=4
pkgdesc="A cross-platform multimedia playback framework based on Qt and FFmpeg"
arch=('x86_64')
url="http://www.qtav.org/"
license=('LGPL')
depends=('qt5-declarative' 'ffmpeg' 'libxv' 'openal' 'uchardet' 'desktop-file-utils'
         'qt5-quickcontrols' 'qt5-svg')
source=("$pkgname-$pkgver.tar.gz::https://github.com/wang-bin/QtAV/archive/v$pkgver.tar.gz"
        qtav-ffmpeg4-1.patch::"https://github.com/wang-bin/QtAV/commit/7f6929b4.patch"
        qtav-ffmpeg4-2.patch::"https://github.com/wang-bin/QtAV/commit/1633f296.patch")
sha512sums=('f273d10a4fe9126cd7d7b1293c087527bf898513e8add7958d905b6039b0c9c3891ea751c40e4c13ba683febff73912322953b151a131726ef8b44db199e0f32'
            'dc3d729597cc7bed82c59b6c74b80935356159b15f75de5beea9568232635f750c70c741c8b1b0a8738eff2fdd910149588457383bc0d1d307e306431bfaa06c'
            'a46d37f00f92860d0b4e9d7c0bb2ec2aabf9517b39876b0ade58081955005eb8be7b4c18d16abcdaf98441c6179924b0bd1974041ede04467e7b7f5953a4fe8b')

prepare() {
  cd QtAV-$pkgver
# Fix build with ffmpeg 4
  patch -p1 -i ../qtav-ffmpeg4-1.patch
  patch -p1 -i ../qtav-ffmpeg4-2.patch
}

build() {
  cd QtAV-$pkgver

  qmake-qt5 "CONFIG+=no_rpath recheck"
  make
}

package() {
  cd QtAV-$pkgver

  make INSTALL_ROOT="${pkgdir}" install
}
